//首页请求接口模型
import { API } from '../utils/config';
import HTTP from '../utils/http';

export default class IndexModel extends HTTP{
  getCourseDatas(field) {
    return new Promise((resolve, reject) => {
      this.fetchGet({
        url: API.getCourseDatas + `?field=${field || 'all'}`,
        success(data) {
          resolve(data);
        },
        error(err) {
          reject(err);
        }
      });
    });
  }
}